version "14.1-20140302.1 [builder]";
dynamic-profiles {
    DYN-VLAN-DEMUX {
        interfaces {
            demux0 {
                unit "$junos-interface-unit" {
                    demux-source inet;
                    vlan-id "$junos-vlan-id";
                    demux-options {
                        underlying-interface "$junos-underlying-interface";
                    }
                    family inet {
                        unnumbered-address lo0.0 preferred-source-address 192.168.0.1;
                    }
                }
            }
        }
    }
    IP-DHCP-PROFILE-1 {
        interfaces {
            demux0 {
                unit "$junos-interface-unit" {
                    demux-options {
                        underlying-interface "$junos-underlying-interface";
                    }
                    family inet {
                        demux-source {
                            $junos-subscriber-ip-address;
                        }
                        unnumbered-address lo0.0 preferred-source-address 192.168.0.1;
                    }
                }
            }
        }
    }
}
system {
    host-name vmx-20;
    time-zone GMT+4;
    root-authentication {
        encrypted-password "$1$r1mevasJ$eSMgu20mBd7qe91Y9Hc3L/"; ## SECRET-DATA
    }
    name-server {
        8.8.4.4;
    }
    dynamic-profile-options {
        versioning;
    }
    login {
        user warrior {
            uid 2000;
            class super-user;
            authentication {
                encrypted-password "$1$CP6.Oezz$vcaU1R2xnijIFVcP66uP9."; ## SECRET-DATA
            }
        }
    }
    services {
        telnet;
        dhcp-local-server {
            pool-match-order {
                ip-address-first;
            }
            authentication {
                password 123;
                username-include {
                    mac-address;
                }
            }
            group 1 {
                dynamic-profile IP-DHCP-PROFILE-1;
                interface ae0.0;
            }
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
            interactive-commands none;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
chassis {
    aggregated-devices {
        ethernet {
            device-count 1;
        }
    }
    network-services enhanced-ip;
}
access-profile Access-Profile-1;
interfaces {
    ge-0/0/1 {
        description "-- uplink & OOB";
        mtu 2000;
        gigether-options {
            no-flow-control;
        }
        unit 0 {
            family inet {
                address 192.168.64.20/24;
            }
        }
    }
    ge-0/0/3 {
        description "-- FREEBSD Server";
        mtu 2000;
        gigether-options {
            no-flow-control;
        }
        unit 0 {
            family inet {
                address 192.168.99.1/24;
            }
        }
    }
    ge-0/0/6 {
        description "-- AE0 link 6";
        gigether-options {
            802.3ad ae0;
        }
    }
    ge-0/0/7 {
        description "-- AE0 link 7";
        gigether-options {
            802.3ad ae0;
        }
    }
    ae0 {
        description "-- aggregation segment";
        flexible-vlan-tagging;
        auto-configure {
            vlan-ranges {
                dynamic-profile DYN-VLAN-DEMUX {
                    accept dhcp-v4;
                    ranges {
                        any;
                    }
                }
            }
            remove-when-no-subscribers;
        }
        mtu 2000;
        encapsulation flexible-ethernet-services;
        aggregated-ether-options {
            no-flow-control;
            lacp {
                active;
                periodic slow;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.20/32 {
                    primary;
                    preferred;
                }
                address 192.168.0.1/32;
            }
        }
    }
}
routing-options {
    static {
        route 0.0.0.0/0 {
            next-hop 192.168.64.2;
            no-readvertise;
        }
    }
    router-id 1.1.1.20;
    autonomous-system 20;
    forwarding-table {
        export lb;
    }
}
policy-options {
    policy-statement lb {
        then {
            load-balance per-packet;
        }
    }
}
access {
    profile Access-Profile-1 {
        accounting-order radius;
        authentication-order radius;
        radius {
            authentication-server 192.168.99.2;
            inactive: accounting-server 192.168.99.2;
            options {
                nas-port-id-delimiter :;
                calling-station-id-delimiter :;
                calling-station-id-format {
                    nas-identifier;
                    interface-description;
                }
                accounting-session-id-format decimal;
                coa-dynamic-variable-validation;
            }
        }
        radius-server {
            192.168.99.2 {
                port 1812;
                accounting-port 1813;
                secret "$9$45Zi.Qz6AtOQFCu0Byr"; ## SECRET-DATA
                timeout 5;
                retry 3;
                max-outstanding-requests 200;
            }
        }
        accounting {
            order radius;
            immediate-update;
            coa-immediate-update;
            update-interval 10;
            statistics volume-time;
        }
    }
    address-assignment {
        pool 1 {
            family inet {
                network 192.168.0.0/24;
                range R1 {
                    low 192.168.0.20;
                    high 192.168.0.30;
                }
                dhcp-attributes {
                    maximum-lease-time 3600;
                    name-server {
                        8.8.4.4;
                    }
                    router {
                        192.168.0.1;
                    }
                }
            }
        }
    }
}
